﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Unused
{
    public class Solution
    {
        public int MinPairSum(int[] nums)
        {
            int num = 0;
            for (int i = 0; i < nums.Length - 1; i++)
            {
                int medium;
                for(int j = 0;j < nums.Length - 1; j++)
                {
                    if (nums[j] > nums[j + 1])
                    {
                        medium = nums[j];
                        nums[j] = nums[j + 1];
                        nums[j + 1] = medium;
                    }
                }
            }
            int maxl = nums.Length;
            for(int x = 0;x < nums.Length / 2; x++)
            {
                if (nums[x] + nums[maxl - 1 - x] > num)
                {
                    num = nums[x] + nums[maxl - 1 - x];
                }
            }
            return num;
        }
    }
}
